<template>
    <div>
        <van-button type="primary" @click="handelScan">调相机</van-button>
    </div>
</template>

<script>
import { commonRegister, beginPullDown, setCamera } from "@/utils/native";

export default {
    data() {
        return {
            text: "接收native方法"
        };
    },
    mounted() {
        commonRegister("beginPullDown", () => {
            this.queryData();
        });
    },
    methods: {
        queryData() {
            console.log("异步请求");
        },
        handelScan() {
            setCamera().then(result => {
                console.log(result);
            });
        }
    }
};
</script>